import pymysql

db_config = {
    "host": "localhost",
    "user": "root",
    "password": "123456",
    "database": "power",
    "charset": "utf8mb4",
    "cursorclass": pymysql.cursors.DictCursor,
}

def connect():
    return pymysql.connect(**db_config)
